//
//  SetupView.m
//  代号：47
//
//  Created by lanou3g on 15/7/1.
//  Copyright (c) 2015年 杨佩璋. All rights reserved.
//

#import "SetupView.h"

#define buttonWidth  60


@interface SetupView ()



@end


@implementation SetupView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc
{
    [_clearBtn release];
    [_adviceBtn release];
    [_aboutBtn release];
    [_versionBtn release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.layer.contents = (id)[UIImage imageNamed:@"Sky.jpg"].CGImage;
        self.alpha = 1;
        _aboutBtn = [[AmazingButton alloc] initWithFrame:CGRectMake(kScreen_width / 2 - 100, 100, buttonWidth, buttonWidth) color:[UIColor orangeColor] type:AmaButtonTypeUser];

        [self addSubview:_aboutBtn];
        UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(_aboutBtn.frame.origin.x, _aboutBtn.frame.origin.y + _aboutBtn.frame.size.height + kLinePadding, buttonWidth, 30)];
        label1.text = @"关于我们";
        label1.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:15];
        [self addSubview:label1];
        [label1 release];
        
        
        _adviceBtn = [[AmazingButton alloc] initWithFrame:CGRectMake(kScreen_width / 2 + 40, 100, buttonWidth, buttonWidth) color:[UIColor darkGrayColor] type:AmaButtonTypeMessage];
        [self addSubview:_adviceBtn];
        UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(_adviceBtn.frame.origin.x, _adviceBtn.frame.origin.y + _adviceBtn.frame.size.height + kLinePadding, buttonWidth, 30)];
        label2.text = @"意见建议";
        label2.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:15];
        [self addSubview:label2];
        [label2 release];
        
        
        _versionBtn = [[AmazingButton alloc] initWithFrame:CGRectMake(kScreen_width / 2 - 100, 200, buttonWidth, buttonWidth) color:[UIColor blueColor] type:AmaButtonTypeLocation];
        [self addSubview:_versionBtn];
        UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(_versionBtn.frame.origin.x, _versionBtn.frame.origin.y + _versionBtn.frame.size.height + kLinePadding, buttonWidth, 30)];
        label3.text = @"版本信息";
        label3.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:15];
        [self addSubview:label3];
        [label3 release];
        
        
        _clearBtn = [[AmazingButton alloc] initWithFrame:CGRectMake(kScreen_width / 2 + 40, 200, buttonWidth, buttonWidth) color:[UIColor purpleColor] type:AmaButtonTypeFodder];
        [self addSubview:_clearBtn];
        UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(_clearBtn.frame.origin.x, _clearBtn.frame.origin.y + _clearBtn.frame.size.height + kLinePadding, buttonWidth, 30)];
        label4.text = @"清除缓存";
        label4.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:15];
        [self addSubview:label4];
        [label4 release];
        
        
        
        
        self.buttons = [NSMutableArray arrayWithCapacity:0];
        [_buttons addObjectsFromArray:@[_clearBtn,_adviceBtn,_aboutBtn,_versionBtn]];

        
    }
    
    return self;
}




@end
